﻿#region imports

using System.Collections.Generic;
using System.Data.Services;
using Codeplex.ODataTFS.Model.Entities;
using Codeplex.ODataTFS.Model.Serialization;

#endregion

namespace Codeplex.ODataTFS.Model.Repositories
{
	public class UserRepository
	{
		private readonly TFSUserProxy _proxy;

		public UserRepository(TFSUserProxy proxy)
		{
			_proxy = proxy;
		}

		public User GetOne(string userName)
		{
			return _proxy.GetUserByUserName(userName);
		}

		public IEnumerable<User> GetAll()
		{
			throw new DataServiceException(501, "Not Implemented", "Service does not currently list all users. Try getting a specific user (e.g. Users('user@live.com') or Users('domain:user') -- replace backslash with ':' character)", "en-US", null);
		}
	}
}
